package com.imooc.form;

import com.imooc.form.group.Insert;
import com.imooc.form.group.Update;
import lombok.Data;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.NotNull;

/**
 * FileName: CategoryForm.java
 * Description: TODO
 *
 * @author HuangRI(874668739 @ qq.com)
 * @version 1.0
 * @date 2020/12/31
 */
@Data
public class CategoryForm {

    /**
     * 类目ID
     */
    @NotNull(message = "类目ID不能为空", groups = {Update.class})
    @Min(message = "类目ID不正确", groups = {Update.class}, value = 0)
    private Integer categoryId;

    /**
     * 类目名称
     */
    @NotEmpty(message = "类目名称不能为空", groups = {Insert.class, Update.class})
    private String categoryName;

    /**
     * 类目编号
     */
    @NotNull(message = "类目编号不能为空", groups = {Insert.class, Update.class})
    @Min(message = "类目ID不正确", groups = {Update.class}, value = 0)
    private Integer categoryType;
}
